package cn.wit.front.controller;

import cn.wit.front.condition.SearchSkillsCondition;
import cn.wit.front.service.SkillsService;
import cn.wit.utils.pojo.Skills;
import cn.wit.utils.response.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/job/skills")
@CrossOrigin
@Api(tags = "面经")
public class SkillsController {
    private Logger logger = LoggerFactory.getLogger(SkillsController.class);

    @Autowired
    private SkillsService skillsService;


    @GetMapping("/searchSkills/{num}/{size}")
    @ApiOperation("分页条件查询所有面经")
    public Result searchSkills(@PathVariable("num") int num,
                               @PathVariable("size") int size, SearchSkillsCondition condition) {
        IPage<Skills> page = new Page<>(num, size);
        return this.skillsService.searchPage(page, condition);
    }
}
